<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\genDeviceList\validate;

use think\Validate;

/**
 * 设备列表验证器
 */
class SkiDeviceListValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'device_id' => 'require',
        'device_name' => 'require',
        'device_type' => 'require',
        'device_sub_type' => 'require',
        'hard_version' => 'require',
        'user_id' => 'require',
        'enable' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'device_id' => '设备编码必须填写',
        'device_name' => '设备名称必须填写',
        'device_type' => '项目类型必须填写',
        'device_sub_type' => '设备子型号必须填写',
        'hard_version' => '硬件版本必须填写',
        'user_id' => '用户id必须填写',
        'enable' => '是否启用必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'device_id',
            'device_name',
            'device_type',
            'device_sub_type',
            'hard_version',
            'user_id',
            'enable',
        ],
        'update' => [
            'device_id',
            'device_name',
            'device_type',
            'device_sub_type',
            'hard_version',
            'user_id',
            'enable',
        ],
    ];

}
